package com.myblog.firstjavaproject;
import java.util.Scanner;
public class Main2 {
    public static void data(int year,int month,int day) {
        if(year<1900||month>12||month<1||day>31||day<0){
            System.out.println("非法输入!");
            return;
        }
        int maxday=31;
        int maxmonth=12;
        if(month==4||month==6||month==9){
            maxday=30;
        }else if(month==2){
            if((year%100==0)|| (year % 4 ==0 && year % 100 != 0))//闰年
            {
                maxday=29;
            }
            else{//平年
                maxday=28;
            }
        }
        if(day>maxday){
            System.out.println("非法输入");return;
        }
        day++;
        if(day>maxday){
            month++;
            day=1;
            if(month>12){
                month=1;
                year++;
            }
        }
        System.out.println(year+"-"+month+"-"+day);
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int year = sc.nextInt();
        int month = sc.nextInt();
        int day = sc.nextInt();
        data(year,month,day);
    }
}
